﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Edit.Master" AutoEventWireup="true" CodeBehind="RealKindArchiveEdit.aspx.cs" Inherits="Web.Views.ArchiveManage.RealKindArchiveEdit" %>

<%@ Register Src="../../UserControls/AttachmentManager.ascx" TagName="AttachmentManager"
    TagPrefix="uc1" %>
<asp:Content ID="Content4" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
    $(function () {

        var options = {
            fit: true,
            closable: false,
            modal: false,
            shadow: false,
            resizable: false
        };
        //初始化ddltext类型的文本框
        $.ajax({
            url: "ResponsebleUserData.xml",
            success: function (result, textStatus) {
                var userArr = xmlToJson(result.documentElement);
                $("<div class='ddl_selectboard'></div>").insertAfter(".ddltext");
                for (var i = 0; i < userArr.User.length; i++) {
                    $(".ddl_selectboard").append("<span>" + userArr.User[i]["#text"] + "</span>");
                }
                $(".ddl_selectboard").panel(options).panel("collapse");
                //ddl
                $(".ddltext").focus(function () {
                    $(".ddl_selectboard").panel(options).panel("expand");
                });
                $(".ddltext").blur(function (event) {
                    //判断鼠标是否在选择框内部，如果不在，则关闭选择面板
                    var offsetdom = $(".ddl_selectboard");
                    var e = window.event || event;
                    var x = e.clientX;
                    var y = e.clientY;
                    var divx1 = offsetdom.offset().left;
                    var divy1 = offsetdom.offset().top;
                    var divx2 = divx1 + offsetdom.width();
                    var divy2 = divy1 + offsetdom.height(); 
                    if(x < divx1 || x > divx2 || y < divy1 || y > divy2)
                    {
                    //如果离开范围，则关闭
                    $(".ddl_selectboard").panel(options).panel("collapse");
                    }
                });

                //选项选中事件
                $(".ddl_selectboard span").click(function () {
                    var item = this;
                    //赋值
                    $(".ddltext").val($(item).text());
                    //输入框获得焦点
                    $(".ddltext")[0].focus();
                });
            }
        });
    });

    /// <summary>Xml转化为JSON</summary>
    function xmlToJson(xml) {

        // Create the return object 
        var obj = {};

        if (xml.nodeType == 1) { // element 
            // do attributes 
            if (xml.attributes.length > 0) {
                obj["@attributes"] = {};
                for (var j = 0; j < xml.attributes.length; j++) {
                    var attribute = xml.attributes.item(j);
                    obj["@attributes"][attribute.nodeName] = attribute.nodeValue;
                }
            }
        } else if (xml.nodeType == 3) { // text 
            obj = xml.nodeValue;
        }

        // do children 
        if (xml.hasChildNodes()) {
            for (var i = 0; i < xml.childNodes.length; i++) {
                var item = xml.childNodes.item(i);
                var nodeName = item.nodeName;
                if (typeof (obj[nodeName]) == "undefined") {
                    obj[nodeName] = xmlToJson(item);
                } else {
                    if (typeof (obj[nodeName].length) == "undefined") {
                        var old = obj[nodeName];
                        obj[nodeName] = [];
                        obj[nodeName].push(old);
                    }
                    obj[nodeName].push(xmlToJson(item));
                }
            }
        }
        return obj;
    }
</script>
<style type="text/css">
    .ddl_selectboard
    {
      position:absolute;
      background-color:#FFFFFF;
      border:#eAF;
      z-index:1000;
      height:230px !important;
    }
.ddl_selectboard span
{
	display:block;
    cursor:pointer;
}
.ddl_selectboard span:hover
{
	background:#e1e1e1;
}
</style>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="button" runat="server">
    <div class="toolbar2">
        <button type="button" class="sexybutton" runat="server" id="btnAddArchiveBack" onserverclick="btnAddArchiveBack_Click"><span><span><span class="add">保存并返回</span></span></span></button>
                <button type="reset" id="btnAddArchive" class="sexybutton"  runat="server" onserverclick="btnAddArchive_Click"><span><span><span class="edit">保存继续录入</span></span></span></button>
        <button type="button" class="sexybutton" runat="server" id="btnBack" onserverclick="btnBack_Click"><span><span><span class="transfer">返回</span></span></span></button>
      </div>
</asp:Content>
<asp:Content ID="Content6" ContentPlaceHolderID="edit" runat="server">
<div style=" margin:10px; margin-right:10px;">
<fieldset>
<legend>著录项信息 <%=archiveTypeName %>
</legend>
<div>
<table cellpadding="0" cellspacing="0" width="100%" class="editTable">
<tr>
<th style="width:12%">档号</th><td style="width:20%"><asp:TextBox ID="txtArchiveNum" runat="server" Width="98%"></asp:TextBox></td>
<th style="width:12%">临时序号</th><td  style="width:20%"><asp:TextBox ID="txtTempOrderNum" runat="server" Width="98%"></asp:TextBox></td>
<th style="width:12%">来源</th><td><asp:TextBox ID="txtArchiveSource" runat="server" Width="98%"></asp:TextBox></td>
</tr>
<tr>
<th>全宗号</th><td><asp:TextBox ID="txtFullFondsNum" runat="server" Width="98%"></asp:TextBox></td>
<th><span class="require_info">*</span>题名</th><td colspan="3"><asp:TextBox ID="txtTitle" runat="server" Width="98%" TextMode="MultiLine" Rows="3"></asp:TextBox></td>
</tr>
<tr>
<th>类别号</th><td><asp:TextBox ID="txtArchiveType" runat="server" Width="98%"></asp:TextBox>
<asp:HiddenField ID="h_ArchiveTypeId" runat="server" />
</td>
<th><span class="require_info">*</span>责任者</th><td><asp:TextBox ID="txtPublisher" runat="server" class="required" Width="98%"></asp:TextBox></td>
<th><span class="require_info">*</span>归档单位</th><td><asp:TextBox ID="txtFileOrgName" runat="server" class="required" Width="98%"></asp:TextBox>
<asp:HiddenField ID="h_FileOrgID" runat="server" />
</td>
</tr>
<tr>
<th>获奖级别</th><td><asp:TextBox ID="txtGloryType" runat="server" Width="98%"></asp:TextBox></td>
<th><span class="require_info">*</span>文件日期</th><td><asp:TextBox ID="txtPublishTime" runat="server" class="easyui-datebox "  Width="160px"></asp:TextBox></td>


<th><span class="require_info">*</span>密级</th><td><asp:DropDownList ID="ddlSecurity" runat="server" Width="160px" class="easyui-combobox "  editable="false" ></asp:DropDownList></td>
</tr>
<tr>
<th><span class="require_info">*</span>保管期限</th><td><asp:DropDownList ID="ddlKeepTime" runat="server" Width="160px" class="easyui-combobox "  editable="false" ></asp:DropDownList></td>
<th><span class="require_info">*</span>载体类型</th><td><asp:DropDownList ID="ddlCarrierType" runat="server" Width="160px" class="easyui-combobox "  editable="false" ></asp:DropDownList></td>
<th><span class="require_info">*</span>保密期限</th><td><asp:DropDownList ID="ddlKeepSecurityTime" runat="server" Width="160px" class="easyui-combobox "  editable="false" ></asp:DropDownList></td>
</tr>
<tr>
<th></th><td></td>
<th>正本数量</th><td><asp:TextBox ID="txtMainBodyNum" runat="server" class="number" MaxLength="5" Width="98%"></asp:TextBox></td>
<th></th><td></td>
</tr>
<tr>
<th>提要</th><td colspan="3"><asp:TextBox ID="txtSummary" runat="server" Width="98%" TextMode="MultiLine" Rows="3" Columns="20"></asp:TextBox></td>
</tr>
<tr>
<th>存放位置</th><td colspan="3"><asp:TextBox ID="txtStorageType" runat="server" Width="98%"></asp:TextBox></td>
</tr>
</table>
</div>
</fieldset>
<fieldset>
  <legend>装盒信息</legend>
  <table width="100%" cellpadding="0" cellspacing="0" class="editTable">
  <tr>
  <th  style="width:12%">盒号</th><td><asp:TextBox ID="txtBoxNum" runat="server" Width="140px" ></asp:TextBox></td>
  </tr>
  </table>

  </fieldset>
  <fieldset>
  <legend>扩展信息</legend>
  </fieldset>
  <fieldset>
  <legend>上交分发</legend>
  </fieldset>
  <uc1:AttachmentManager ID="attachArchive"  AttachmentDBHelperString="RealKind"   runat="server"  />
  <h3>审核进度</h3>
  <ep:EPGridView ID="gv_AprroveView" runat="server" Width="100%"></ep:EPGridView>
   <asp:HiddenField ID="hiddenCurrentFlowName" runat="server" Value="移交" />
   <asp:HiddenField ID="hiddenCurrentStatusName" runat="server" Value="录入中" />
  </div>
</asp:Content>

